/**
 * MineAdmin is committed to providing solutions for quickly building web applications
 * Please view the LICENSE file that was distributed with this source code,
 * For the full copyright and license information.
 * Thank you very much for using MineAdmin.
 *
 * @Author X.Mo<root@imoi.cn>
 * @Link   https://github.com/mineadmin
 */
import type { MaFormItem } from '@mineadmin/form'
import hasAuth from '@/utils/permission/hasAuth.ts'
import MaUploadFile from '@/components/ma-upload-file/index.vue'
import { concat } from 'lodash-es'

export default function getFormItems(formType: 'add' | 'edit' = 'add', t: any, model: any): MaFormItem[] {
    

      return concat([
    { label: '计划描述', prop: 'plan_description', render: 'editor', renderProps: { placeholder: t('form.pleaseInput', { msg: '计划描述'}) } },
    { label: '广播文字内容', prop: 'content_text', render: 'editor', renderProps: { placeholder: t('form.pleaseInput', { msg: '广播文字内容'}) } },
    { label: '音频文件路径', prop: 'content_audio_file', render: () => MaUploadFile, renderProps: { placeholder: t('form.pleaseInput', { msg: '音频文件路径'}) }, multiple: false },
    { label: '目标设备（JSON格式：设备ID数组）', prop: 'target_devices', render: 'input', renderProps: { placeholder: t('form.pleaseInput', { msg: '目标设备（JSON格式：设备ID数组）'}) } },
    { label: '目标分组（JSON格式：分组名称数组）', prop: 'target_groups', render: 'input', renderProps: { placeholder: t('form.pleaseInput', { msg: '目标分组（JSON格式：分组名称数组）'}) } },
    { label: '开始时间，控制播放时间段', prop: 'start_time', render: 'input', renderProps: { placeholder: t('form.pleaseInput', { msg: '开始时间，控制播放时间段'}) } },
    { label: '结束时间，控制播放时间段', prop: 'end_time', render: 'input', renderProps: { placeholder: t('form.pleaseInput', { msg: '结束时间，控制播放时间段'}) } },
    { label: '执行日期，逗号间隔，按不同重复类型', prop: 'execution_day', render: 'input', renderProps: { placeholder: t('form.pleaseInput', { msg: '执行日期，逗号间隔，按不同重复类型'}) } },
    { label: '重复类型：1-不重复，2-每天，3-每周，4-每月', prop: 'repeat_type', render: 'input', renderProps: { placeholder: t('form.pleaseInput', { msg: '重复类型：1-不重复，2-每天，3-每周，4-每月'}) }, itemProps: { rules: [
    { required: true, message: '请输入重复类型：1-不重复，2-每天，3-每周，4-每月' },
  ] } },
    { label: '重复间隔（分钟）', prop: 'repeat_interval', render: 'input', renderProps: { placeholder: t('form.pleaseInput', { msg: '重复间隔（分钟）'}) } },
    { label: '重复次数', prop: 'repeat_count', render: 'input', renderProps: { placeholder: t('form.pleaseInput', { msg: '重复次数'}) }, itemProps: { rules: [
    { required: true, message: '请输入重复次数' },
  ] } },
    { label: '触发事件ID', prop: 'trigger_event', render: 'input', renderProps: { placeholder: t('form.pleaseInput', { msg: '触发事件ID'}) } },
    { label: '触发条件（JSON格式）', prop: 'trigger_condition', render: 'input', renderProps: { placeholder: t('form.pleaseInput', { msg: '触发条件（JSON格式）'}) } },
    { label: '音量', prop: 'volume_day', render: 'input', renderProps: { placeholder: t('form.pleaseInput', { msg: '音量'}) }, itemProps: { rules: [
    { required: true, message: '请输入音量' },
  ] } },
    { label: '最后执行时间', prop: 'last_execution_time', render: 'DatePicker', renderProps: { placeholder: t('form.pleaseInput', { msg: '最后执行时间'}) }, mode: 'date', showTime: true },
    { label: '已执行次数', prop: 'execution_count', render: 'input', renderProps: { placeholder: t('form.pleaseInput', { msg: '已执行次数'}) }, itemProps: { rules: [
    { required: true, message: '请输入已执行次数' },
  ] } },
  ]);
}
